package com.dnjn.happiness.score.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum AppraiseScoreEnum {

    D_(1, -30.0),
    D(2, -20.0),

    C_(3, -10.0),
    C(4, 0.0),

    B_(5, 10.0),
    B(6, 20.0),

    A_(7, 30.0),
    A(8, 40.0),

    S_(9, 50.0),
    S(10, 60.0);


    private Integer like;

    private Double score;

    public static Double getScore(Integer like) {
        AppraiseScoreEnum[] values = AppraiseScoreEnum.values();
        for (AppraiseScoreEnum item : values) {
            if (like.equals(item.like)) {
                return item.score;
            }
        }
        return 0.0;

    }
}
